import request from '@/router/axios'
import {approveStatus, getApproveStatus, getLineName, getStationName, getMappingStatus} from "../../../../subwayRat/commonCheck";

export function get_xw_ReportErrorList(query) {
  return request({
    url: '/check/xw/get_xw_ReportErrorList',
    method: 'post',
    params: query
  })
}

export function update_xw_ReportError(query) {
  return request({
    url: '/check/xw/update_xw_ReportError',
    method: 'post',
    params: query
  })
}

export function update_xw_ReportPromise(query) {
  return request({
    url: '/check/xw/update_xw_ReportPromise',
    method: 'post',
    params: query
  })
}


export const XW_SQ_other_tableOption={
  editBtn:false,
  delBtn:false,
  addBtn:false,
  border: true,
  index:true,
  indexLabel:'序号',
  page:true,
  align:'center',
  menuWidth:150,
  menuAlign:'center',
  selection: true,
  reserveSelection:true,
  height:450,
  column:[
    {prop:"lineCode", label:"线路",type:'select',search:true,searchslot:true,formatter: function(row, value , label, column){
        return getLineName(value);
      }},
    {prop:"stationCode", label:"站点",search:true,searchslot:true,formatter: function(row, value , label, column){
        return getStationName(row.lineCode,value);
      }},
    {prop:"applyTime" ,label:"申请时间",width: 90},
    {prop:"reprotTime", label:"报表时间",width: 90},
    {prop:"errorClassification",label:"差错类别",formatter:function (row,v) {
        return getMappingStatus('ERROR_CLASSIFICATION',v);
      }},
    // {prop:"errorAmount", label:"差异金额"},
    {prop:"applyReason" ,label:"申请原因",width: 150},
    {prop:"reportName", label:"报表名称",width: 90},
    {
      prop:"creatorName",
      label:"申请人",
      search:true,
      params: {
        userCodeKey: "creatorCode"
      },
      component: "user-select"
    },
    {prop:"creatorCode", label:"申请人员工号",width: 100},
    {prop:"modifyTime", label:"更改日期",width: 90},
    {prop:"isModify", label:"是否修改",formatter:function(row,value){
        return value==0?'否':(value==1?'是':'');
      }},
    {prop:"modifyLimitTime", label:"修改期限(天)",width: 100},
    {prop:"checkStatus", label:"审批状态",type:'select',search:true,dicData:approveStatus(),formatter:function(row,value){
        return getApproveStatus(value);
      }}]
}
